package lng.site.tatoo.services;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import lng.site.tatoo.IDao.TatooUserIDAO;
import lng.site.tatoo.IServices.TatooUserIServices;
import lng.site.tatoo.model.TatooUser;
import lng.site.tatoo.model.User;
@Service
@Transactional(readOnly = true)
public class TatooUserServices implements TatooUserIServices{
	
	@Autowired
	private TatooUserIDAO tatooUserDao;
	
	@Transactional(readOnly = false)
	public void addTatooUser(TatooUser user) {
		// TODO Auto-generated method stub
		getTatooUserDao().save(user);
	}
	@Transactional(readOnly = false)
	public void updateTatooUser(TatooUser user) {
		// TODO Auto-generated method stub
		getTatooUserDao().update(user);
	}
	@Transactional(readOnly = false)
	public void deleteTatooUser(TatooUser user) {
		// TODO Auto-generated method stub
		getTatooUserDao().delete(user);
	}
	
	public TatooUser getTatooUserById(int id) {
		// TODO Auto-generated method stub
		return getTatooUserDao().getById(id);
	}
	
	public List<TatooUser> getTatooUsers() {
		// TODO Auto-generated method stub
		return getTatooUserDao().findAll();
	}

	public TatooUserIDAO getTatooUserDao() {
		return tatooUserDao;
	}

	public void setTatooUserDao(TatooUserIDAO tatooUserDao) {
		this.tatooUserDao = tatooUserDao;
	}
	
}